testintel: add missing test for AvgDown3D.forward (created by linxwang) - #1096
Conversation
Candidate cand:9cf47afdeacb6b6d0378129eb4bf01c2 at 2f01706.
…rence Address review: compare full output against a hand-computed reference for factor_s=2 with in_channels != out_channels (deterministic torch.arange input), verifying spatial block grouping and channel/group mapping instead of only asserting output shape.
pre-commit's black hook wraps the AvgDown3D(...) constructor call in test_forward_downsamples_spatial_and_channel_dims onto multiple lines (line was too long). No behavior change.
There was a problem hiding this comment.
🟢 Approval recommended
The change is isolated to a new unit test file and the assertions align with the current AvgDown3D implementation behavior.
Pull request overview
Adds targeted unit-test coverage for the WAN VAE AvgDown3D downsampling module to ensure its grouped channel averaging and temporal/spatial downsampling behaviors are exercised in CI.
Changes:
- Introduces a new unit test module that instantiates
AvgDown3Dand validates output shape/value semantics. - Covers both the temporal left-padding branch (
pad_t > 0) and the grouped-channel averaging path (group_sizebehavior). - Adds a negative test to confirm incompatible
(in_channels * factor) % out_channels != 0is rejected.
File summaries
| File | Description |
|---|---|
| tests/unit_tests/backends/diffusion/test_wan_vae_avgdown3d.py | New focused tests validating AvgDown3D.forward behavior (padding, reshape/permute mapping, averaging) plus init assertion. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
The revised test itself looks good and passes against current |
|
TestIntel PR Steward: Thanks @WangLingxun for the catch. You're right that Copilot's automated review came back with an approval recommendation and no actionable comments. This PR remains draft; I'll keep watching for CI, further review comments, and a human approval before merging. |
| @@ -0,0 +1,94 @@ | |||
| ############################################################################### | |||
| # Copyright (c) 2025, Advanced Micro Devices, Inc. | |||
There was a problem hiding this comment.
This is a newly added file, so the copyright year should be 2026.
Address review comment from WangLingxun: newly added file should use 2026.
|
TestIntel PR Steward: Addressing @WangLingxun's review comment on No other outstanding review comments. Still draft; watching for CI, further review, and a human approval before requesting a merge. |
There was a problem hiding this comment.
🟢 Approval recommended
The change is test-only, aligns with the stated goal, and the assertions match the current AvgDown3D implementation (padding and reshape/permute/group-mean behavior).
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
TestIntel PR Steward: Investigated the CI failure on the current head ( Most of the checks the poll flagged as failed ( The one genuine failure, in the latest run ( That's an unrelated test (Megatron trainer memory benchmark, not |
|
TestIntel PR Steward: Status check on this poll:
CI is now running on the new head via run |
There was a problem hiding this comment.
🟢 Approval recommended
It adds well-scoped, deterministic unit tests that match the implementation’s padding and reshape/permute semantics without changing production behavior.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Lite
|
TestIntel PR Steward: Merged (squash, All conditions were met at this poll:
Thanks all for the review. |
Same-repo refile of #1083 so Primus-CI-TAS runs against
AMD-AGI/Primus(fork PRs do not receive Docker Hub credentials, sobuild-docker/ torch unit tests never ran).This PR was created by linxwang via Test Gap Resolver.
No existing test in tests/unit_tests/backends/diffusion (or anywhere else in the repo) instantiates AvgDown3D or imports vae2_2.py at all; the pad->view->permute->view->view->mean sequence that implements grouped spatiotemporal average-downsampling, including the temporal padding branch (pad_t>0) and the group_size averaging for group_size>1 with in_channels != out_channels (plus the independent spatial/channel mapping oracle), is completely unexercised.
This PR adds a focused unit test for
AvgDown3D.forward; it does not change production code.